package com.asa.control_theory.utils.bean;

import com.asa.HanShu;
import com.asa.utils.Calculate;
import com.asa.utils.MathUtils;

/**
 * 	状态转移矩阵
 * @author Administrator
 *
 */
public class ZhuangTai_ZhuanYi_Matrix {

	private HanShu[][] matrix;

	public HanShu[][] getMatrix() {
		return matrix;
	}

	public void setMatrix(HanShu[][] matrix) {
		this.matrix = matrix;
	}
	
	
	public double[][] move_t(double t){
		double[][] result = new double[matrix.length][matrix[0].length];
		for (int i = 0; i < matrix.length; i++) {
			for (int j = 0; j < matrix.length; j++) {
				HanShu hanShu = matrix[i][j];
				
				result[i][j] = hanShu.hanshu(t);
				
			}
		}
		
		
		return result;

	}
	
	/**
	 *  定积分
	 * @param t0
	 * @param t
	 * @return
	 */
	public double[][] dingjifen(double t0,double t){
		
		double[][] result = new double[matrix.length][matrix[0].length];
		for (int i = 0; i < matrix.length; i++) {
			for (int j = 0; j < matrix.length; j++) {
				HanShu hanShu = matrix[i][j];
				result[i][j] = Calculate.hanshujifen(t0,t,hanShu);
			}
		}
		
		return result;
		
	}
	
	/**
	 * 	导数
	 */
	
	public double[][] dao(double t0){
		
		double[][] result = new double[matrix.length][matrix[0].length];
		for (int i = 0; i < matrix.length; i++) {
			for (int j = 0; j < matrix.length; j++) {
				HanShu hanShu = matrix[i][j];
				result[i][j] = MathUtils.dao(t0, hanShu);
			}
		}
		
		return result;
		
	}
	
	
	
	
}
